Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development
Message handling in Progress Dynamics
Some of the validation procedure examples above have introduced you to the Progress Dynamics convention for formatting messages to be returned to the client for display. This section describes the include files that you can use to facilitate this.
Messages in Progress Dynamics are stored in the Repository so that the text and translations of all messages can be maintained independently of their use in applications.
![]()
To see the messages that are shipped with the product, to add more messages for your application, or to translate existing ones:
- From the Administration menu, select System
Message Control.
The Message Control browser lets you look at some of the characteristics of Progress Dynamics messages with which you need to be familiar to refer to them properly in your applications, as shown:
![]()
Each message is assigned to a Message Group. (The Error Group label, as seen in the previous figure, is somewhat misleading. All messages, including informational messages that are not errors at all, are maintained together in the message table.) These groups are two-letter codes used simply to organize messages in a sensible way. The two predefined message groups in Progress Dynamics are
AF, for messages that are a basic part of the application framework, andRY, for messages that are generated primarily by procedures responsible for maintaining the Repository itself. All of these messages are available for your use when you are building applications. You should use the existing messages wherever possible before defining additional messages of your own. The message numbers in the code generated by the Object Generator, for example, are references to standard messages in theAFgroup in the Repository.Within the Message Group, each message is given a unique number. The combination of Message Group and Message Number is unique throughout the application. It is these first two arguments to the
aferrortxt.iinclude file that identify the message.Each message also has a Language Code. As shown in the first lines of the above figure, you can translate each message into different languages. Each translation uses the same Message Group and Message Number, so that a reference to that key within an application identifies the message. The login language of the current user tells Progress Dynamics which translation to choose.
The third and fourth arguments to the include file are the table name and field name with which the message is associated. You should specify these arguments if they are meaningful.
Messages can contain additional arguments that are substituted into the base message text using the numbered replacement references (&1 etc.). Up to nine additional arguments can be passed to the include file, to be used as replacements in either the message summary or the longer message text that is defined in the Message Maintenance utility and displayed as part of the Progress Dynamics message dialog box.
- To add a new message, choose Add in the Message Control.
- To translate an existing message, choose Copy, since the Message Group, Number, and Type should be the same for the translation of the message. The Message Maintenance window appears.
You can select any language you have previously defined in the Language Control. (To run the Language Control, from the Administration window, select Application
Language Control.)
The Error Summary Description is a short form of the message. The editor at the bottom of the Message Maintenance screen lets you enter a longer description for the message, which will be displayed if the user expands the message display dialog box. These two descriptions share up to nine substitution parameters that can be passed along with the reference to the message in the application code.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |